/*
 * KickMessage.java
 *
 * Created on June 19, 2007, 10:27 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package jhub.text;

import java.text.MessageFormat;
import java.text.ParseException;
import jhub.DCProtocol;

/**
 *
 * @author dbotelho
 */
public class KickMessage extends DCRawCommand{
    
    public static KickMessage getInstance(String nick) throws ParseException{
        return new KickMessage(MessageFormat.format(DCProtocol.KICK_FORMAT,nick));
    }
    
    private String nick;
    
    /** Creates a new instance of KickMessage */
    public KickMessage(String nick) throws ParseException{
        super(nick);
        parse();
    }
    
    private void parse() throws ParseException{
        Object[] o = new MessageFormat(DCProtocol.KICK_FORMAT).parse(command.toString());
        this.nick = o[0].toString();
    }

    public String getNick() {
        return nick;
    }
    
}
